package cn.mcsys.myadmin.dubbo.service;

import cn.mcsys.myadmin.modules.air.entity.*;
import cn.mcsys.myadmin.modules.air.vo.AirRidePointVO;
import cn.mcsys.myadmin.modules.mobile.entity.AirRealtimeUserCount;
import cn.mcsys.myadmin.modules.mobile.entity.AirRealtimeUserOrigin;
import cn.mcsys.myadmin.modules.mobile.entity.AirUserFlowCount;
import cn.mcsys.myadmin.modules.platform.entity.AirVehicleGpsBus;
import cn.mcsys.myadmin.modules.platform.entity.AirVehicleGpsTaxi;
import cn.mcsys.myadmin.modules.share.dto.AirCarDTO;
import cn.mcsys.myadmin.modules.share.entity.AirOutsideCar;
import cn.mcsys.myadmin.modules.viewer.entity.*;
import cn.mcsys.myadmin.modules.worker.entity.AirTaxi;
import cn.mcsys.myadmin.modules.worker.vo.WorkerIndexVO;

import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface BackService {

    /**
     * 根据乘车站点查询所有对应的车辆
     * @return
     */
    List<AirCar> selectByPointId(Integer pointId);

    String sayHi();

    List<AirRidePoint> selectAllPoint();
    List<AirRidePoint> selectAllPoint2();

    AirRidePoint selectPointById(Integer id);

//    电子票
    List<AirETickets> selectETicketsByUserId(Long id);

    /**
     * 根据证件类型和证件号查询对应的航展票
     * @param type
     * @param number
     * @return
     */
    List<AirTickets> selectByTypeAndNumber(int type, String number);

    void saveETicket(List<AirTickets> airTickets, AirViewerUser user);

    List<AirETickets> selectByManyId(Long[] eTicketsId);

    void setQrCodeId(Long[] airETickets, AirRideQrCode airRideQrCode);


//    观众端用户
    AirViewerUser selectByOpenidAndState(String openid);

    AirViewerUser selectByUsername(String username);

    void save(AirViewerUser currentUser);

    List<AirSendMessage> getMessageByReceiverType(int type);


//    二维码
    AirRideQrCode save(Long ridePoint, Long[] eTicketsId, String bookingDate, String phone, AirViewerUser user);

    AirRideQrCode get(AirRideQrCode airRideQrCode);

    List<AirRideQrCode> selectByUserQRCodeId(Long id);

    List<AirRideQrCode> selectByDate(String date);


    List<AirSendMessage> SelectAirUserMessage();

//    工作人员端
    List<AirTaxi> select20sGPS(Date currentDate, Date beforeDate);

    AirCar selectByCarNumber(String vehicleNo);

    void isSameDay(Long[] eTicketsIds,String bookingDate) throws ParseException;

    AirTickets selectByAirTickets(AirTickets airTickets);

    void  saveTicket(AirTickets airTickets);

    AirParkingLocation saveLocation(AirParkingLocation airParkingLocation);

    List<AirRealtimeMessage> getSubmission(String date);

    List<AirRealtimeMessage> getMessageByAirRidePointIdWithTime(Integer airRidePointId,String date);

    void sendMessage(Integer airRidePointId,AirRealtimeMessage airRealtimeMessage,String carNumber);

    Map<String, Integer> getMessageByAirRidePointId(Integer airRidePointId);

    //大屏
    List<AirRidePointVO> selectAllWaitingPoint();

    List<AirCar> getAllCarList();
    List<AirCar> getAllPointsCar();


    AirWorker workerLogin(String username, String password);

    WorkerIndexVO workerIndex(AirWorker airWorker);

    void updateCarStatus(Long airCarId, Integer status);

    void insertCarStartLog(AirWorker airWorker,Long airCarId, int status,int sum);

    void insertRealTimeMessage(AirWorker workerUser, Long airCarId, int riding, Integer sum);

    void insertWaitingRealTimeMessage(AirWorker workerUser, Integer sum);

    void insertTypeRealTimeMessage(AirWorker airWorker,Integer type, String message);

    void updateWaitingSum(Integer pointId, Integer sum);

    List<AirSendMessage> getMessageByWorker(AirWorker userWorker);
    List<AirSendMessage> getMessageByPointId(Integer pointId);

    void insertCarRecord(AirCar car, int riding);

    void autoInsertRealTimeMessage(AirCar car, int riding);

    List<AirCar> getAllCarsHavingGPS();

    List<AirVehicleGpsBus> getBusGps(Date currentDate, Date beforeDate);

    List<AirVehicleGpsTaxi> getTaxiGps(Date currentDate, Date beforeDate);

    List<AirCarRecord> getAirCarRecordToday();

    List<AirCarRecord> getAirCarRecordLeast();
    List<AirCarRecord> getAirCarRecordInTime(String formatDate, Integer airRidePointId);
    List<AirCarRecord> getLeastRecordByStatusAndPointId( Integer airRidePointId, Integer status);

    AirCarRecord selectLatestCarRecord(AirCar airCar, Integer status);

    AirCarRecord selectLatestCarRecordWithDate(AirCar airCar, int i, Date recordDate);


    Integer selectBookingSumByPointId(Integer id);

    List<AirTickets> selectTickets(Date begin, Date end);

    List<AirCarDTO> trafficList();

    List<AirCar> selectLikeByCarNumber(Integer pointId, String carNumber);

    void batchInsertRealtimeUserCount(List<AirRealtimeUserCount> airRealtimeUserCounts);

    void batchInsertUserFlowCount(List<AirUserFlowCount> airUserFlowCounts);

    List<AirCar> getCarByStatusAndAirRidePointId(Integer status, Integer airRidePointId);

    List<AirETickets> selectAllETickets(int pageNo);
    List<AirTickets> getAllTicketsToday();

    List<AirRideQrCode> selectAllQrCode(int pageNo);

    List<AirTickets> selectAllTickets(int pageNo);

    void UpdateExpiredETickets(List<Long> expiredETickets);

    void UpdateExpiredQrCodes(List<Long> expiredETickets);

    void UpdateExpiredTickets(List<Long> expiredTickets);

    void updateIsOnLine(Integer id,Integer isOnline);

    List<AirETickets> selectMyAllETickets(Long id);

    List<AirRideQrCode> selectAllQRCode();

    Integer getAllQRCodeToday();

    List<AirRideQrCode> getQRCodeListByStatusToday(Integer status);

//    void saveAirCarSumRecord(AirCarSumRecord airCarSumRecord);
//
//    List<AirCarSumRecord> getSumRecordWithTime(Date date);
    void saveAirCarSumRecord(AirCarSumRecord airCarSumRecord);

    List<AirCarSumRecord> getSumRecordWithTime(Date date);

    void saveTaxiSumRecord(AirCarSumRecord airCarSumRecord);

    List<AirTaxi> selectAllTaxi();

    AirCar getCarDetailByCarNumber(String carNumber);
    AirCar getCarDetailByCarId(Integer id);
    AirRidePoint getRidePointByName(String name);
    Integer getRidePointSeatById(Integer id);
    List<AirWorker> getWorkersByRidePointId(Integer airRidePointId);

    List<AirCarRecord> getRecordTodayByPointId(Integer airRidePointId);

    List<AirDriver> getDrivers();

    List<AirRealtimeMessage> getMessageLeast();

    void cancelBooking(Long qrcodeId, Long id);

    void batchSaveTickets(List<AirTickets> airTicketsList);

    List<AirRealtimeUserCount> getUserCountsToday();

    List<AirUserFlowCount> getUserFlowCountsToday();

    AirRidePoint selectByQrId4Point(Long qrcodeId);

    List<AirRidePoint> selectOutSidePoint();

    List<AirRealtimeUserCount> getUserCountsLeast();

    void batchcreatepicture(List<AirRideQrCode> airRideQrCodes);

    List<AirCar> selectZHAllCarList();

    List<AirVehicleGpsBus> selectAllBus();

    List<AirVehicleGpsTaxi> selectAllTaxis();


    List<AirCar> selectAllAirshowCar();

    List<AirOutsideCar> selectAllOutSideCar();

    void updateWorkLonLat(AirWorker airWorker);

    List<AirRidePoint> selectByPointType(Integer type);

    AirRideQrCode bookingHotelPointAndGZABridge(AirViewerUser user, Integer pointId,String booingDate, Long[] eTicketsIds, String phone);

    void batchInsertRealtimeUserOrigin(List<AirRealtimeUserOrigin> airRealtimeUserOrigins);

    List<AirVehicleGpsBus> selectByShuttleBus();

    void insertBusRecord(AirVehicleGpsBus bus, int shuttlebustFinish);

    AirShuttlebusRecord selectShuttlebusRecord(Integer id);

    List<AirRealtimeUserOrigin> getUserOriginLeast();

    AirParkingLocation getParkingLocation(Long airParkingLocationId);

    List<AirRealtimeMessage> getMessageLeastByPointId(Integer airRidePointId);

    List<AirRideQrCodeSpecial> getQrCodeSpecialByNote(String note);
    List<AirRideQrCodeSpecial> getAllQrCodeSpecialToday();

    List<AirRideQrCodeSpecial> selectByNotNull4SpecialCode();

    void updateRideQrCodeSpecial(AirRideQrCodeSpecial airRideQrCodeSpecial);

    List<AirVehicleGpsBus> getBusByNote(String note);

    WorkerIndexVO workerVipIndex(Integer pointId);

    void clearCarStatus(Integer id);

    Integer selectCountByPointId(Integer id,String date);

    List<AirRideQrCodeSpecial> getAllQrCodeSpecialByDate(String pointId, String date);
}
